package com.itlong.cloud.equip.sdk;

import com.itlong.cloud.POJO.DTO.sdk.CloudTalkSDKMediaSaveOrUpdateDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * <desc>
 *      云对讲SDK多媒体资源服务接口暴露。
 * <desc/>
 *
 * @createDate 2018/05/22
 */
@FeignClient(name = "equip-service")
public interface ICloudTalkSDKMediaServiceClient {

    /**
     * <desc>
     *     根据条件projectId和deviceUnique获取云对讲设备类型
     * </desc>
     *
     * @param projectId 项目id
     * @param deviceUnique 设备序列号
     * @return 云对讲类型
     * @author wangzhi
     * @createDate 2018/05/22
     */
    @PostMapping(path = "cloudTalkSDK/media/getCloudIntercomByProjectIdAndDeviceUnique")
    Integer getCloudIntercomByProjectIdAndDeviceUnique(@RequestParam("projectId") String projectId,
                                                       @RequestParam("deviceUnique") String deviceUnique) throws Exception;

    /**
     * <desc>
     *     根据条件projectId和mediaId查询多媒体资源mediaId，用于验证多媒体资源是否存在
     * </desc>
     *
     * @param projectId 项目id
     * @param mediaId 多媒体资源id
     * @return 多媒体资源id
     * @author wangzhi
     * @createDate 2018/05/22
     */
    @PostMapping(path = "cloudTalkSDK/media/getMediaIdByProjectIdAndMediaId")
    String getMediaIdByProjectIdAndMediaId(@RequestParam("projectId") String projectId, @RequestParam("mediaId") String mediaId) throws Exception;

    /**
     * <desc>
     *     保存多媒体资源
     * </desc>
     *
     * @param cloudTalkSDKMediaSaveDTOS 待保存的数据集
     * @return
     * @author wangzhi
     * @createDate 2018/05/22
     */
    @PostMapping(path = "cloudTalkSDK/media/saveMedia")
    List<CloudTalkSDKMediaSaveOrUpdateDTO> saveMedia(@RequestBody List<CloudTalkSDKMediaSaveOrUpdateDTO> cloudTalkSDKMediaSaveDTOS) throws Exception;

    /**
     * <desc>
     *     更新多媒体资源
     * </desc>
     *
     * @param cloudTalkSDKMediaUpdateDTOS 待更新的数据集
     * @return
     * @author wangzhi
     * @createDate 2018/05/22
     */
    @PostMapping(path = "cloudTalkSDK/media/updateMedia")
    List<CloudTalkSDKMediaSaveOrUpdateDTO> updateMedia(@RequestBody List<CloudTalkSDKMediaSaveOrUpdateDTO> cloudTalkSDKMediaUpdateDTOS) throws Exception;

}
